import Vue from "vue";

import VueRouter from "vue-router";

import Home from "../views/Home.vue"
import User from "../views/User.vue"
import Main from "../views/Main.vue"
import Mall from "../views/Mall.vue"
import FollowUpRequest from "../views/Followuprequest.vue"
import FollowUpPlan from "../views/Followupplan.vue"
import register from "../views/register.vue"
import Diary from "../views/Diary.vue"
import review from "../views/review.vue"
import application from "../views/application.vue"
import Management from "../views/Management.vue"
import approval from "../views/approval.vue"
import Performance from "../views/Performance.vue"
import statistics from "../views/statistics.vue"
import Login from "../views/Login.vue"//登录
import Loginup from "../views/loginup.vue"//登录
import Monitor from  "../views/monitor.vue"
// import PageOne from "../views/PageOne.vue"
// import PageTwo from "../views/PageTwo.vue"

const routes = [
    {
        path: '/', component: Main,
        redirect: '/home',
        children: [
            { path: 'home', name: 'home', component: Home },//首页
            { path: 'user', name: 'user', component: User },//用户管理
            { path: 'mall', name: 'mall', component: Mall },//新闻管理
            { path: 'FollowUpRequest', name: 'FollowUpRequest', component: FollowUpRequest },//回访请求
            { path: 'FollowUpPlan', name: 'FollowUpPlan', component: FollowUpPlan },//回访计划
            { path: 'register', name: 'register', component: register },//进度登记
            { path: 'Diary', name: 'Diary', component: Diary },//回访日记
            { path: 'review', name: 'review', component: review },//政治面貌审核
            { path: 'application', name: 'application', component: application },//回访申请
            { path: 'Management', name: 'Management', component: Management },//申请管理
            { path: 'approval', name: 'approval', component: approval },//进度审批
            { path: 'Performance', name: 'Performance', component: Performance },//成绩评估
            { path: 'statistics', name: 'statistics', component: statistics },//数据统计
            { path: 'monitor', name: 'monitor', component: Monitor }

        ]
    },
    {
        path: '/login',
        component: Login
    },
    {
        path: '/loginup',
        component: Loginup
    }
]
const originalPush = VueRouter.prototype.push
VueRouter.prototype.push = function push(location) {
    return originalPush.call(this, location).catch(err => err)
}
Vue.use(VueRouter)

const router = new VueRouter({
    routes
})
export default router
